Published 2007-06-27 00:05:19

Two minor updates this week, First the GtkDjs manual now works in IE, along with featuring user comments, - you can just add normal comments, code examples, rewrite the introduction, or note a bug. Eventually I plan to add an approval flag so it moves the comment into the documentation, along with the ability to create a comment based on another comments or the existing documentation. And maybe HTML comments...

As for the bindings I've been looking at the GtkTreeView and Gtk.TreeStore. To push it a bit, I built a little file navigator (in the tests folder). Key to this was the ability to store Javascript objects in the Treestore. My initial idea of just using a gpointer to the class turned into a bit of a disaster, as the garbage collector assumed that the object was not being used, (even though a pointer to it remained in the store), and free'ed it. This leed to segfaults later when trying to read it.

To solve this I ended up using boxed types, so hopefully I've implemented so the objects now get free'd correctly..

I've also simplified the setting method for the store (next on the list is to look at  the fetching methods). So storing data in a node/row is a mater of:
store.append(iter,parentIter); 
store.set(iter, 0, "node title");
store.set(iter, 1, {directory: pdir + name + "/" });
Getting a directory listing uses the new Phobos (or generic D binding backend) binding code.
var filelist = File.listdir("/home/alan");
I did notice one little gotcha for the dmdscript backend, that it does not support the "in" comparison operator So
if ("fred" in myobject) {...}
becomes
if (myobject.hasOwnProperty("fred")) {....}

Talking of gotcha's I spent quite a long time getting the manual to work in IE. My little extjs tricks noted that comma's are a bit of a nightmare in IE, in that It doesnt like trailing comma's in lists of object properties. As typical with any Microsoft product, this is totally inconsistant with the behaviour for arrays, in which case it quite happily accepts trailing commans. Not only does it accept them,  it adds an undefined element on the end of the array... - which broke my method list horribly in IE.

Otherwise getting it to work in IE basically consisted of using Ext.DomQuery rather than trying to use standard DOM calls which never seem to work as expected. Anyway comment away...



Mentioned By:
google.com : april (98 referals)
google.com : december (54 referals)
google.com : inurl:blog.php?user= (36 referals)
google.com : blog.php?user= (11 referals)
www.dzone.com : GtkDjs updates - manual in IE, user comments and treemodel object storage (10 referals)
google.com : extjs object expected (8 referals)
google.com : extjs ie (6 referals)
google.com : extjs manual (6 referals)
google.com : gtkdjs (6 referals)
google.com : extjs "object expected" (4 referals)
google.com : hasOwnProperty IE (4 referals)
www.planet-php.net : Planet PHP (3 referals)
google.com : ie hasOwnProperty (3 referals)
www.dzone.com : DZone - New links (2 referals)
google.com : ext-js manual (2 referals)
google.com : ext-js ie (2 referals)
google.com : ieuser dom storage delete (2 referals)
google.com : inurl:"blog.php?user" (2 referals)
google.com : manual extjs (2 referals)
www.phpeye.com : PHPEye.com | Zend Framework|PHP5|PHP教程|PHP论坛|PHP下载|PHP框架|PHP编程|PHP新闻|PEAR| - Powered by HappyCMS (1 referals)

Add Your Comment